[PET-39] Upgrade to zod v4 (Upgrade Zod to v4 and update imports and enum references)#40
[PET-39] Upgrade to zod v4 (Upgrade Zod to v4 and update imports and enum references)#40
Conversation
WalkthroughThe PR upgrades Zod from v3 to v4 and updates imports across the codebase from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
🚀 Expo preview is ready!
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/hooks/useDailyPuzzle/useDailyPuzzle.test.ts (1)
251-317: Consolidate duplicated “attempt is correct” tests into one case.These three blocks are effectively the same scenario and can be merged to keep the suite focused.
♻️ Suggested cleanup
- it('should trigger createPuzzleAttempt mutation on onSubmitAttempt action - success scenario, attempt is correct', async () => { - ... - }); - - it('should trigger createPuzzleAttempt mutation on onSubmitAttempt action - success scenario, attempt is correct', async () => { - ... - }); + // Keep a single "attempt is correct" integration-style test for this flow.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/hooks/useDailyPuzzle/useDailyPuzzle.test.ts` around lines 251 - 317, There are duplicate test cases for the "attempt is correct" success path; remove the redundant test blocks and keep a single spec that asserts onSubmitAttempt calls createPuzzleGuessAttempt with { userId: testUser1._id, puzzleId: testDailyPuzzle1._id, attempt: 'spawn' }, then calls markPuzzleAsSolved with { puzzleId: testDailyPuzzle1._id, userId: testUser1._id }, emits captureEvent('puzzle:solved', { puzzleId: ..., userId: ..., type: puzzleType.enum.daily }), and does not call mockToast — update the remaining test (calling result.current.onSubmitAttempt) to have a clear unique description and delete the duplicate test that repeats the same assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/hooks/useDailyPuzzle/useDailyPuzzle.test.ts`:
- Around line 251-317: There are duplicate test cases for the "attempt is
correct" success path; remove the redundant test blocks and keep a single spec
that asserts onSubmitAttempt calls createPuzzleGuessAttempt with { userId:
testUser1._id, puzzleId: testDailyPuzzle1._id, attempt: 'spawn' }, then calls
markPuzzleAsSolved with { puzzleId: testDailyPuzzle1._id, userId: testUser1._id
}, emits captureEvent('puzzle:solved', { puzzleId: ..., userId: ..., type:
puzzleType.enum.daily }), and does not call mockToast — update the remaining
test (calling result.current.onSubmitAttempt) to have a clear unique description
and delete the duplicate test that repeats the same assertions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4a7d76de-16a6-4c55-8abc-8b229211e3b4
⛔ Files ignored due to path filters (4)
convex/_generated/dataModel.d.tsis excluded by!**/_generated/**convex/_generated/server.d.tsis excluded by!**/_generated/**convex/_generated/server.jsis excluded by!**/_generated/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (57)
convex/dictionary/models.tsconvex/leaderboardEntries/model.tsconvex/leaderboards/models.tsconvex/leaderboards/queries.tsconvex/notifications/queries.tsconvex/puzzleGuessAttempts/helpers.tsconvex/puzzleGuessAttempts/models.tsconvex/puzzleGuessAttempts/queries.tsconvex/puzzles/internal.tsconvex/puzzles/models.tsconvex/puzzles/queries.tsconvex/shared/models.tsconvex/shared/queries.tsconvex/userPuzzleStatistics/internal.tsconvex/userPuzzleStatistics/models.tsconvex/userPuzzleStatistics/queries.tsconvex/users/models.tsconvex/users/queries.tseslint.config.jspackage.jsonsrc/__tests__/leaderboards/all-time-leaderboard.test.tsxsrc/__tests__/leaderboards/weekly-leaderboard.test.tsxsrc/__tests__/onboard/gameplay-settings.test.tsxsrc/__tests__/play/daily-puzzle-solved.test.tsxsrc/__tests__/play/training-puzzle-solved.test.tsxsrc/__tests__/settings.test.tsxsrc/app/(authenticated)/history/daily-challenges.tsxsrc/app/(authenticated)/history/training-challenges.tsxsrc/app/(authenticated)/leaderboards/all-time-leaderboard.tsxsrc/app/(authenticated)/leaderboards/weekly-leaderboard.tsxsrc/app/(authenticated)/play/daily-puzzle-solved.tsxsrc/app/(authenticated)/play/training-puzzle-solved.tsxsrc/app/(authenticated)/settings.tsxsrc/app/onboard/gameplay-settings.tsxsrc/app/onboard/restore-account.tsxsrc/components/elements/GuessGrid/GuessGrid.hook.tssrc/components/elements/GuessGrid/GuessGrid.test.tsxsrc/components/elements/GuessGrid/GuessGrid.tsxsrc/components/elements/HistoryGrid/HistoryGrid.test.tsxsrc/components/elements/HistoryGrid/HistoryGrid.tsxsrc/components/elements/Keyboard/Keyboard.test.tsxsrc/components/elements/Keyboard/Keyboard.tsxsrc/constants/puzzles.tssrc/hooks/useDailyPuzzle/useDailyPuzzle.test.tssrc/hooks/useDailyPuzzle/useDailyPuzzle.tssrc/hooks/useGameplaySettings/useGameplaySettings.test.tssrc/hooks/useGameplaySettings/useGameplaySettings.tssrc/hooks/useLeaderboards/useLeaderboards.test.tssrc/hooks/useLeaderboards/useLeaderboards.tssrc/hooks/usePuzzlesStatistics/usePuzzlesStatistics.test.tssrc/hooks/useTrainingPuzzle/useTrainingPuzzle.test.tssrc/hooks/useTrainingPuzzle/useTrainingPuzzle.tssrc/tests/fixtures/leaderboards.tssrc/tests/fixtures/puzzleGuessAttempts.tssrc/tests/fixtures/puzzleStatistics.tssrc/tests/fixtures/puzzles.tssrc/utils/words.ts
Summary by CodeRabbit
Chores
Refactor